Optimization of Dynamically Generated Sql Queries for Tiny-huge, Huge-tiny Problem
نویسنده
چکیده
In most new commercial business software applications like Customer Relationship Management, the data is stored in the database layer which is usually a Relational Database Management System (RDBMS) like Oracle, DB2 UDB or SQL Server. To access data from these databases, Structured Query Language (SQL) queries are used that are generated dynamically at run time based on defined business models and business rules. One such business rule is visibilitythe capability of the application to restrict data access based on the role and responsibility of the user logged in to the application. This is generally achieved by appending security predicates in the form of sub-queries to the main query based on the roles and responsibility of the user. In some cases, the outer query may be more restrictive while in other cases, the security predicates may be more restrictive. This often results in a dilemma for the cost-based optimizer (CBO) of the backend database whether to drive from the outer query or drive from the security predicate sub-queries. This dilemma is sometimes called the “Tiny-Huge, Huge-Tiny” problem and results in serious performance degradation by way of increased response times on the application User Interface (UI). This paper provides a case study of a new approach to vastly reduce this CBO dilemma by a combination of denormalized columns and re-writing of the security predicates’ sub-queries at run-time, thereby levelling the outer and security sub-queries. This approach results in more stable execution plans in the database and much better performance of such SQLs, effectively leading to higher performance and scalability of the application.
منابع مشابه
Expressive Power of SQL
It is a folk result in database theory that SQL cannot express recursive queries such as reachability; in fact, a new construct was added to SQL3 to overcome this limitation. However, the evidence for this claim is usually given in the form of a reference to a proof that re-lational algebra cannot express such queries. SQL, on the other hand, in all its implementations has three features that f...
متن کاملHuge Data Sets and the Frontiers of Computational Feasibility
Recently, Huber (1994) offered a taxonomy of data set sizes ranging from tiny (10 bytes) to huge (10 bytes). This taxonomy is particularly appealing because it quantifies the meaning of tiny, small, medium, large and huge. Indeed, some investigators consider 300 small and 10,000 large while others consider 10,000 small. In Huber’s taxonomy, most statistical and visualization techniques are comp...
متن کاملRule Induction for Semantic Query Optimization
Semantic query optimization can dramatically speed up database query answering by knowledge intensive reformulation. But the problem of how to learn required semantic rules has not previously been solved. This paper describes an approach using an inductive learning algorithm to solve the problem. In our approach, learning is triggered by user queries and then the system induces semantic rules f...
متن کاملScheduling Single-Load and Multi-Load AGVs in Container Terminals
In this paper, three solutions for scheduling problem of the Single-Load and Multi-Load Automated Guided Vehicles (AGVs) in Container Terminals are proposed. The problem is formulated as Constraint Satisfaction and Optimization. When capacity of the vehicles is one container, the problem is a minimum cost flow model. This model is solved by the highest performance Algorithm, i.e. Network Simple...
متن کاملAn Effective SPARQL Support over Relational Databases
Supporting SPARQL queries over relational databases becomes an active topic recently. However, it has not received enough consideration when SPARQL queries include restrictions on values (i.e filter expressions), whereas such a scenario is very common in real life applications. Challenges to solve this problem come from two aspects, (1) databases aspect. In order to fully utilize the well-devel...
متن کامل